package com.oo.polymorphic_4.drink;

import java.util.Scanner;

/**
 * Coffee--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 15:48
 **/
public class Coffee extends Drink{

    public Coffee() {
        super("咖啡");
    }

    @Override
    protected void buy() {
        String msg = "";
        System.out.println("请问是否要配料：（1.加糖，2.加奶，3.什么都不加）");
        Scanner sc = new Scanner(System.in);
        int id = sc.nextInt();
        switch (id) {
            case 1:
                msg += "加糖";
                break;
            case 2:
                msg += "加奶";
                break;
            default:
                msg += "什么都不加";
        }
        System.out.println("名称："+this.getName()+"\n添加配料："+msg
        +"\n容量："+this.getCapacity());
    }
}
